'use strict';

import { Application } from 'egg'

const apiSuperAuthHeader = '/super-auth/template-page'

const getSuperAuthApi = (path: string) => {
  return `${apiSuperAuthHeader}/${path}`
}

export default (app: Application) => {
  const { router, controller } = app;

  router.get(apiSuperAuthHeader, controller.templatePage.index);
  router.post(apiSuperAuthHeader, controller.templatePage.create);
  router.post(getSuperAuthApi(':id'), controller.templatePage.update);
  router.delete(getSuperAuthApi(':id'), controller.templatePage.remove);
};